# $Id: mt-default_umask.pl 2 2009-07-11 04:35:20Z taketoshi.y $

package MT::Plugin::DefaultUmask;

use strict;
use MT::Plugin;
@MT::Plugin::DefaultUmask::ISA = qw(MT::Plugin);

use vars qw($PLUGIN_NAME $VERSION);
$PLUGIN_NAME = 'DefaultUmask';
$VERSION = '';

use MT;
my $plugin = new MT::Plugin::DefaultUmask({
    name => $PLUGIN_NAME,
    version => $VERSION,
    description => "<MT_TRANS phrase='description of DefaultUmask'>",
    author_name => '',
    author_link => '',
    l10n_class => 'DefaultUmask::L10N',
});

MT->add_plugin($plugin);

sub init_registry {
    my $plugin = shift;
    $plugin->registry({
        config_settings => {
            'HTMLUmask'   => { default => '0022', },
            'UploadUmask' => { default => '0022', },
            'DirUmask'    => { default => '0022', },
        }
    });
}


sub instance { $plugin; }

sub doLog {
    my ($msg) = @_; 
    return unless defined($msg);

    use MT::Log;
    my $log = MT::Log->new;
    $log->message($msg) ;
    $log->save or die $log->errstr;
}

1;